<template>
    <div class="child">
        <h3>子组件:2</h3>
        <p>我有：{{ toy }} 玩具</p>
        <p>我有：{{ bookNum }} 本书</p>
    </div>
</template>

<script setup lang="ts" name="Child2">
import { ref } from 'vue';


let toy = ref('游戏王卡片')
let bookNum = ref(100);

defineExpose({bookNum,toy})
</script>
.value
<style scoped>
.child {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    background-color: #f0f0f0;
}
</style>
